// import shop from '../../api/shop'

// initial state
const state = () => ({
    info: {
        changeNum: 0, // 该字段用来触发改变
        baseInfo: {
            userCode: '-1',
            userName: '访客',
        },
        extInfo: {
            common: {
                cardTransparency: '2',
            },
            bg: {
                // pc端背景
                pc: {
                    showType: 'url', // none:无背景 url:链接 color:颜色
                    url: [],
                    color: 'white'
                },
                // 手机端背景
                mobile: {
                    showType: 'url', // none:无背景 url:链接 color:颜色
                    url: [],
                    color: 'white'
                }
            },
            guides: [],
            logo: {
                showType: 'none',
                url: ''
            },
            search: {
                sugSwitch: true,
                hisSwitch: true,
                engines: [],
            }
        },
    }

})

// getters
const getters = {}

// actions
const actions = {
    // async getAllProducts({ commit }) {
    //     const products = await shop.getProducts()
    //     commit('setProducts', products)
    // }
}

// mutations
const mutations = {
    setUser(state, user) {
        user.changeNum += 1;
        state.info = user
    },
}

export default {
    namespaced: true,
    state,
    getters,
    actions,
    mutations
}